//
//  MainMenuScene.m
//  ProjectLila
//
//  Created by Tedo on 6/21/10.
//  Copyright 2010 sushigames. All rights reserved.
//

#import "MainMenuScene.h"
#import "PlayerMenuScene.h"
#import "ParticleScene.h"
#import "TestScene.h"

@implementation MainMenuLayer

- (id) init {
	self = [super init];
	if (self) {
		[CCMenuItemFont setFontSize:28];
        [CCMenuItemFont setFontName:@"Verdana"];
        CCMenuItem *new = [CCMenuItemFont itemFromString:@"New Game"
												target:self
											  selector:@selector(newGame:)];
        CCMenuItem *load = [CCMenuItemFont itemFromString:@"Load Game"
											   target:self
											 selector:@selector(stub:)];
		[load setIsEnabled:NO];
        CCMenuItem *settings = [CCMenuItemFont itemFromString:@"Scene Test"
											   target:self
													 selector:@selector(stub:)];
//		[settings setIsEnabled:NO];
        CCMenuItem *particle = [CCMenuItemFont itemFromString:@"Particle Test"
													   target:self
													 selector:@selector(particle:)];
        CCMenu *menu = [CCMenu menuWithItems:new, load, settings, particle, nil];
        [menu alignItemsVerticallyWithPadding:30.0];
        [self addChild:menu];
	}
	return self;
}

- (void)newGame:(id)sender {
	[[CCDirector sharedDirector] replaceScene:[CCFadeTransition transitionWithDuration:0.5f scene:[PlayerMenuScene scene]]];
}

- (void)particle:(id)sender {
	[[CCDirector sharedDirector] replaceScene:[CCFadeTransition transitionWithDuration:0.5f scene:[ParticleScene scene]]];
}

- (void)stub:(id)sender {
	[[CCDirector sharedDirector] replaceScene:[CCFadeTransition transitionWithDuration:0.5f scene:[TestScene scene]]];
}

@end


@implementation MainMenuScene

+(id) scene {
	MainMenuScene *scene = [MainMenuScene node];
	[scene addChild:[MainMenuLayer node]];
	
	return scene;
}

@end
